package com.hdax.search.thread;

public class ThreadTest {

    public static void main(String[] args) {
        /**
         * 继承Thread
         * 实现Runnable接口
         * 实现Callable接口，FutureTask (可以拿到返回结果，可以处理异常)
         * 线程池
         */

        System.out.println("main方法开始了");
        Thread01 thread=new Thread01();
        thread.start();
        System.out.println("main方法结束了");
    }


    public static class Thread01 extends Thread{
        @Override
        public void run() {
            System.out.println("当前线程"+Thread.currentThread().getId());
            int i = 10/2;
            System.out.println("运行结果："+i);
        }
    }
}
